﻿#pragma once
//【头文件包含】
//C++的主要头文件
#include<iostream>//c++的输入输出流
using std::cout, std::endl;

/*实践：实现一个完善的日期类*/class Date
{
public:

	/*构造函数*/Date(int year=0 , int month=1 , int day=1 );
	/*拷贝构造*/Date(const Date& d);
	/*运算符重载*/
	bool operator<(const Date& d)const;
	bool operator>(const Date& d)const;
	bool operator==(const Date& d)const;
	bool operator<=(const Date& d)const;
	bool operator>=(const Date& d)const;
	bool operator!=(const Date& d)const;

	Date& operator=(const Date& d);
	Date& operator+=(int day);
	Date operator+(int day);//循环
	Date& operator-=(int day);
	Date operator-(int day);
	Date& operator++();//前置返回加之后的值
	Date operator++(int);//后置，返回加之前值 
	Date& operator--();
	Date operator--(int);
	int  operator-(const Date& d)const; 
	
	/*取地址重载*/Date* operator&();
	/*const取地址重载*/const Date* operator&()const;
	/*打印日期*/void Print()const;
	/*根据年月获取当月天数*/int GetMonthDay(int year, int month)const;
	/*析构函数*/~Date();
	
private:
	int _year;
	int _month;
	int _day;
	

	
protected:

};